const https = require('https')

const http = require('http')
const querystring = require("querystring")
const logger = require('../log')

const server = http.createServer((req, res) => {
    https.get('https://www.xiaomiyoupin.com/api/auth/login/isloggedin', (result) => {
        let data = ''
        result.on('data', (chunk) => {
            data += chunk
        })
        result.on('end', () => {
            res.writeHead(200, {
                'content-type': "text/html"
            })
            res.write(JSON.stringify(querystring.parse(data)))
            res.end()
        })
    })
  



})
server.listen('3000', () => {
    console.log('q');
})
